package com.java.demo;

import com.java.demo.component.BeanComponent;
import com.java.demo.controller.UserController;
import com.java.demo.controller.UserController2;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        //ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
//        UserController userController = context.getBean(UserController.class);
//        userController.printUser();
//
//        UserController2 userController2 = context.getBean(UserController2.class);
//        userController2.printUser2();
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        BeanComponent bean = context.getBean(BeanComponent.class);
        bean.sayHi();
        context.destroy();
    }
}
